package com.syni.mdd.sjb.common.datatreaure.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.DankGroup;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.mapper.DankGroupMapper;
import com.syni.mdd.sjb.common.datatreaure.service.DankGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lcc
 * @since 2020-10-23
 */
@Service
public class DankGroupServiceImpl extends ServiceImpl<DankGroupMapper, DankGroup> implements DankGroupService {

    @Autowired
    DankGroupMapper dankGroupMapper;

    @Override
    public Map<Integer, DankGroup> getGroupByIds(Set<Integer> typeSet) {
        Map<Integer,DankGroup> dankGroupMap = new HashMap<>();
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.in(DankGroup.TYPE,typeSet);
        List<DankGroup> dankGroupList = dankGroupMapper.selectList(queryWrapper);
        for(DankGroup d :dankGroupList){
            dankGroupMap.put(d.getType(),d);
        }
        return dankGroupMap;
    }
}
